<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>常用控制语句—switch case</title>
</head>
<body>
<script>
  let day = "";
  let today = new Date().getDay();
  console.log(today);
  switch (today) {
    case 0:
      day = "星期天";
      break;
    case 1:
      day = "星期一";
      break;
    case 2:
      day = "星期二";
      break;
    case 3:
      day = "星期三";
      break;
    case 4:
      day = "星期四";
      break;
    case 5:
      day = "星期五";
      break;
    case 6:
      day = "星期六";
  }
  console.log(day);
</script>
</body>
</html>